import request from './request.js';

// 图片路径
export const imageApi = 'https://www.essp.top/supplyChain/Image/';
export const webviewApi = 'https://www.essp.top/supplyChain/view/';
// export const webviewApi = 'http://127.0.0.1:5504/view/';

// 通用相关接口
export const generalApi = {
	// 根据SQL查询数据客户端接口 不需要token
	generalQueryBySQLSerialNumberWithClient: (params) => request.post('/clientOperation/generalQueryBySQLSerialNumber', params),
	
	// 根据SQL查询数据带分页客户端接口 不需要token
	generalPaginationQueryBySQLSerialNumberWithClient: (params) => request.post('/clientOperation/generalPaginationQueryBySQLSerialNumber', params),
	
	// 根据SQL查询数据带分页客户端接口 不需要token
	generalSaveByRequestBodyWithClient: (params) => request.post('/clientOperation/generalSaveByRequestBody', JSON.stringify(params).replace(/'/g, "''"), {
		header: {
			'Content-Type': 'application/json',
		}
	}),
}

// 新闻相关接口
export const newsApi = {


}

// 商品相关接口
export const goodsApi = {
	
	
}

export const orderApi = {
	
	
}

// 用户相关接口
export const userApi = {
	// 登录
	login: (params) => request.post('/login/userLogin', params),
	
	// 获取openid
	getOpenId: (params) => request.get('/getWeChatOpenIDAction', params, {
		service: 'ENUM2',
	}),
	

	// 订单相关接口
	
	
	
	// 发送验证码
	code: (params) => request.get(`/login/getVerificationCode?Telephone=${params}`), 


}


// 全局配置接口
export const getConfig = () => request.get('/config')

// 导出所有API
export default {
	...generalApi,
	...newsApi,
	...userApi,
	...goodsApi,
	...orderApi,
	getConfig
}